<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles"%>
<%@ taglib uri="http://jsptags.com/tags/navigation/pager" prefix="pg"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>房产信息</title>
<LINK href="images/css.css" type="text/css" rel="stylesheet">
</head>
<body>
 <center>
<table class="tableline" id="Table1" cellspacing="1" cellpadding="0" width="100%" border="0">
    <tr>
     <td colspan="12" class="STYLE4" align="center" bgcolor="#ffffff" colspan="2" height="40">房产信息列表页面
     &nbsp;&nbsp;&nbsp;&nbsp; <a href="house.do?method=add">增加房产信息</a>
     </td>
     </tr>
      <tr>
     <td colspan="12"  align="center" bgcolor="#ffffff" height="40">
	<c:if test="${!empty subDistrictList}">
		<c:forEach items="${subDistrictList}" var="subDistrict">
        <a href="house.do?method=unspecified&subDistrict_id=${subDistrict.id }">${subDistrict.name }</a> &nbsp;&nbsp;&nbsp;
         </c:forEach>
    </c:if>
     </td>
     </tr>
    <tr align="center">
      <td width="9%" height="40" bgcolor="#ffffff">房产编号</td>
      <td width="9%" bgcolor="#ffffff">房产名称</td>
      <td width="9%" bgcolor="#ffffff">房屋类型</td>
      <td width="9%" bgcolor="#ffffff">房产来源</td>
      <td width="9%" bgcolor="#ffffff">房产面积</td>
      <td width="9%" bgcolor="#ffffff">单元数</td>
      <td width="9%" bgcolor="#ffffff">楼层数</td>
      <td width="9%" bgcolor="#ffffff">所属小区</td>
      <td width="9%" bgcolor="#ffffff">所属楼栋</td>
      <td width="9%" bgcolor="#ffffff">所属业主</td>
      <td colspan="2" bgcolor="#ffffff">操作</td>
    </tr>
<c:if test="${!empty pm.datas}">
	<c:forEach items="${pm.datas}" var="house">
        <tr align="center">
          <td bgcolor="#ffffff">${house.houseId }</td>
          <td bgcolor="#ffffff">${house.name }</td>
          <td bgcolor="#ffffff">${house.type.name }</td>
          <td bgcolor="#ffffff">${house.source.name}</td>
          <td bgcolor="#ffffff"><fmt:formatNumber value="${house.area}" pattern="0.00" /></td>
          <td bgcolor="#ffffff">${house.unit}</td>
          <td bgcolor="#ffffff">${house.floor}</td>
          <td bgcolor="#ffffff">${house.building.subDistrict.name}</td>
          <td bgcolor="#ffffff">${house.building.name}</td>
          <td bgcolor="#ffffff">${house.owner.name}</td>
          <td bgcolor="#ffffff"><a href="house.do?method=update&id=${house.id }">修改</a></td>
          <td bgcolor="#ffffff"><a href="house.do?method=delete&id=${house.id }">删除</a></td>
        </tr>
      </c:forEach>
    </c:if>
    <tr>
	<td bgcolor="#ffffff" colspan="12">
		<center>
			<pg:pager url="house.do" items="${pm.total }" export="currentPageNumber=pageNumber">
				<pg:first>
					<a href="${pageUrl }&subDistrict_id=${subDistrict.id }">首页</a>

				</pg:first>
				<pg:prev>
					<a href="${pageUrl }&subDistrict_id=${subDistrict.id }">上一页</a>
				</pg:prev>
				<pg:pages>
					<c:choose>
						<c:when test="${currentPageNumber eq pageNumber}">
							<font color="red">${pageNumber }</font>
						</c:when>
						<c:otherwise>
							<a href="${pageUrl }&subDistrict_id=${subDistrict.id }">${pageNumber }</a>
						</c:otherwise>
					</c:choose>
				</pg:pages>
				<pg:next>
					<a href="${pageUrl }&subDistrict_id=${subDistrict.id }">下一页</a>
				</pg:next>
				<pg:last>
					<a href="${pageUrl }&subDistrict_id=${subDistrict.id }">尾页</a>
				</pg:last>
			</pg:pager>
		</center>
		</td>
	</tr>
  </table>
</center>
</body>
</html>